﻿using System;
using System.Windows.Forms;

namespace HYRElectric.Calculate
{
	public class RiaDataGridView : DataGridView
	{
		public MultiHeader MultiHeaders
		{
			get
			{
				if (this.multiHeaders == null)
				{
					this.multiHeaders = new MultiHeader(this);
					base.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
					foreach (object obj in base.Columns)
					{
						DataGridViewColumn dataGridViewColumn = (DataGridViewColumn)obj;
						dataGridViewColumn.DisplayIndex = dataGridViewColumn.Index;
					}
				}
				return this.multiHeaders;
			}
			set
			{
				if (value == null && this.multiHeaders != null)
				{
					base.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
					this.multiHeaders.Dispose();
					this.multiHeaders = value;
				}
			}
		}

		private MultiHeader multiHeaders;
	}
}
